<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="utf-8">
  

  
  <title>Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta property="og:type" content="website">
<meta property="og:title" content="Hexo">
<meta property="og:url" content="http://yoursite.com/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:locale" content="en">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Hexo">
  
    <link rel="alternate" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
</head>
</html>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main">
  
    <article id="post-python集训-人脸识别" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/12/26/python集训-人脸识别/" class="article-date">
  <time datetime="2019-12-26T12:49:11.000Z" itemprop="datePublished">2019-12-26</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/12/26/python集训-人脸识别/">python集训 _人脸识别</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>   最近集训了为期四天的python培训，主要是学习人脸识别。<br>   首先说一下遇到的问题汇总，1.python的环境配置 2.python的pip安装 3.pycharm的使用<br>关于python的环境配置，目前有很多种版本的python。如3.7.0，3.8.0，我之前安装的是3.8的python，所以有很多老师提供3.7版本pip我安装不上，pypi上也没有对应的3.8版本。所以我卸载了原先的3.8安装了3.7(最简单的卸载方法就是找到python的源文件双击uninstall，找不到就更新一个更高的版本安装后再卸载)。要记好python的安装路径。<br>然后是pip的安装，首先要确定你所需要的pip是否能和你的python版本对应的上，不对应可以去pypi的官网或者国内的镜像网站清华源找。找到之后下载到任意路径，然后打开下载到的文件夹，在上方输入cmd。输入pip install +文件名字(打出几个字母后按tab键)。输入pip list可以查看你所安装的全部pip，输入pip uninstall+文件名 可以卸载对应pip。<br>pycharm的使用，这才是重点。原来以前我写的那些代码都是用虚拟环境运行的，难怪import pygame一直失败。使用pycharm时如果不使用已安装的python环境他会给你创建一个虚拟环境，虚拟环境的优点是体积小，随项目移动。但是你安装的pip他是不会自动识别的，需要手动的添加进去。操作步骤为：文件-设置-项目-project Interpreter-右方的+号(-号就是删除)-然后搜索pip。<img src="/2019/12/26/python集训-人脸识别/%E9%80%89%E6%8B%A9python%E7%8E%AF%E5%A2%83.png" alt><br>    这次实训主要是对cv2的一些操作讲解以及认识到图片，声音，视频的数字化。图片就是一个三维的。可以使用print(cv2. imread(‘./文件名.’))查看文件是一个几维的。对图片来说，一二维确定图片的长宽，三维确定颜色(红绿蓝，全255为白，全0为黑)。贴一个代码 将人物的眼睛替换为心。</p>
<figure class="highlight nix"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">import</span> cv2  <span class="comment"># 导入cv2包</span></span><br><span class="line"></span><br><span class="line"><span class="attr">face</span> = cv2.imread('./face1.jpg')  <span class="comment"># 将face1读取并赋给face</span></span><br><span class="line"><span class="attr">eye_detector</span> = cv2.CascadeClassifier('./haarcascade_eye.xml.')  <span class="comment"># 使用方法CascadeClassifier定义一个眼睛探测器</span></span><br><span class="line"><span class="attr">eye_zones</span> = eye_detector.detectMultiScale(face, <span class="attr">scaleFactor=1.08,</span> <span class="attr">minNeighbors=50)</span>  <span class="comment"># 使用眼睛探测器定位出face中的眼睛位置</span></span><br><span class="line">for x, y, w, h <span class="keyword">in</span> eye_zones:</span><br><span class="line">    <span class="attr">heart</span> = cv2.imread('./heart.jpg')  <span class="comment"># 读取heart图片赋值给变量heart</span></span><br><span class="line">    <span class="attr">heart</span> = cv2.resize(heart, <span class="attr">dsize=(w,</span> h))  <span class="comment"># 重新定义heart的大小</span></span><br><span class="line">    for i <span class="keyword">in</span> range(w):</span><br><span class="line">        for j <span class="keyword">in</span> range(h):</span><br><span class="line">            <span class="keyword">if</span> (heart[i, j][<span class="number">0</span>] &lt; <span class="number">10</span>) &amp; (heart[i, j][<span class="number">1</span>] &lt; <span class="number">10</span>) &amp; (heart[i, j][<span class="number">2</span>] &lt; <span class="number">10</span>):  <span class="comment"># 检测图片的颜色，黑色则pass</span></span><br><span class="line">                pass</span><br><span class="line">            <span class="keyword">else</span>:</span><br><span class="line">                face[y + i, x + j] = heart[i, j]  <span class="comment"># 未被检测为黑色的部分被赋给face的眼睛部分</span></span><br><span class="line">cv2.imshow('face', face)  <span class="comment"># 弹出一个窗口显示修改后的图片</span></span><br><span class="line">cv2.waitKey(<span class="number">0</span>)  <span class="comment"># 等待键盘输入，0为无限等待</span></span><br><span class="line">cv2.destroyAllWindows()  <span class="comment"># 释放内存</span></span><br></pre></td></tr></table></figure>


      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/12/26/python集训-人脸识别/" data-id="ck4mql4da0004tsudvkkv1a7u" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/python/">python</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="post-学生信息课题实现及源代码" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/09/29/学生信息课题实现及源代码/" class="article-date">
  <time datetime="2019-09-29T08:55:12.000Z" itemprop="datePublished">2019-09-29</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/09/29/学生信息课题实现及源代码/">学生信息课题实现及源代码</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>今天在编一个关于学生信息的课题。简单来说就是先用结构体写一个程序，要求能够写入和输出信息，以及学生成绩的一些计算。(后来加入了增删改查功能)</p>
<p>完成之后要将结构体改写为类。原理很简单，只需要将类的private和public改写一下即可，但是运行后有十几个类似的bug，花费了一些时间找到解决方法。</p>
<p>error说的是我定义的类外函数没有声明过。具体原因是类外函数和类中声明的函数没有完全一致，类外的函数中有形参可是声明函数时没有写形参。<br>举个例子，class的类中声明的时void i_message();   然而定义的是void i_message(int num)。所以出了bug。<br><img src="/2019/09/29/学生信息课题实现及源代码/%E4%B8%80%E4%B8%AA%E7%B1%BB%E5%A4%96%E5%87%BD%E6%95%B0%E5%AE%9A%E4%B9%89%E7%9A%84error.png" alt></p>
<p>在上机时需要做的时在VC++里将代码分离成 : 类声明头文件(包含需要用到的头文件和类的定义)、类实现文件(包含需要用到的头文件和类成员函数的定义)、<br>类使用文件(需要用到的头文件和main函数)。当然using namespace std是三个文件都必须的。<br>在类实现文件和类使用文件中必须要包括#include”类声明头文件的名称.h”。</p>
<p>建立工程:建立一个工程中的控制台应用，然后建立两个source file，一个headline file，记得添加到工程。三个文件的命名最好有相应的含义。</p>
<p>在函数分离完成后很多关于变量没有定义的问题 ，原因是源代码中定义的类实例是个全局变量，然而函数分离后形成了三个定义域，所以程序自然出了bug。<br>解决方法是将定义类实例移至主函数，通过主模块包含的头文件来实现不同定义域的调用。</p>
<p>附上源代码:</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br></pre></td><td class="code"><pre><span class="line">c++</span><br><span class="line"><span class="comment">//因为类实例a[]不是全局变量，所以需要给每个类实现函数传递一个实例a[]的首地址</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span><span class="meta-string">&lt;iostream&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span><span class="meta-string">&lt;string&gt;</span></span></span><br><span class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="built_in">std</span>;</span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Message</span></span></span><br><span class="line"><span class="class">&#123;</span></span><br><span class="line"> <span class="keyword">public</span>:</span><br><span class="line">        <span class="function"><span class="keyword">void</span> <span class="title">i_message</span><span class="params">(Message a[],<span class="keyword">int</span> num)</span></span>;</span><br><span class="line">        <span class="function"><span class="keyword">void</span> <span class="title">o_message</span><span class="params">(Message a[],<span class="keyword">int</span> num)</span></span>;</span><br><span class="line">        <span class="function"><span class="keyword">int</span> <span class="title">compare_max</span><span class="params">(Message a[],<span class="keyword">int</span> i)</span></span>;</span><br><span class="line">        <span class="function"><span class="keyword">int</span> <span class="title">compare_min</span><span class="params">(Message a[],<span class="keyword">int</span> i)</span></span>;</span><br><span class="line">        <span class="function"><span class="keyword">void</span> <span class="title">av_ma_mi</span><span class="params">(Message a[],<span class="keyword">int</span> num)</span></span>;</span><br><span class="line">        <span class="function"><span class="keyword">void</span> <span class="title">serch</span><span class="params">(Message a[],<span class="keyword">int</span> num)</span></span>; </span><br><span class="line">        <span class="function"><span class="keyword">void</span> <span class="title">alter</span><span class="params">(Message a[],<span class="keyword">int</span> num)</span></span>;</span><br><span class="line">        <span class="function"><span class="keyword">void</span> <span class="title">remove</span><span class="params">(Message a[],<span class="keyword">int</span> num)</span></span>;</span><br><span class="line">        <span class="function"><span class="keyword">void</span> <span class="title">add</span><span class="params">(Message a[],<span class="keyword">int</span> num)</span></span>; </span><br><span class="line">        </span><br><span class="line"> <span class="keyword">private</span>:</span><br><span class="line">        <span class="built_in">string</span> name;<span class="comment">//姓名</span></span><br><span class="line">        <span class="keyword">int</span> number;<span class="comment">//学号</span></span><br><span class="line">        <span class="keyword">int</span> grade1;<span class="comment">//第一科成绩</span></span><br><span class="line">        <span class="keyword">int</span> grade2;<span class="comment">//第二科成绩</span></span><br><span class="line">        <span class="keyword">int</span> grade3;<span class="comment">//第三科成绩</span></span><br><span class="line">        </span><br><span class="line">&#125;;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">input</span><span class="params">()</span><span class="comment">//将学生的总数赋给num变量</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">        <span class="keyword">int</span> num;</span><br><span class="line">        <span class="built_in">cout</span>&lt;&lt;<span class="string">"共有几个学生:"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        <span class="built_in">cin</span>&gt;&gt;num;</span><br><span class="line">        <span class="keyword">return</span> num;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">void</span> Message::i_message(Message a[],<span class="keyword">int</span> num)<span class="comment">//输入num个学生的信息</span></span><br><span class="line">&#123;</span><br><span class="line">        <span class="keyword">for</span>(<span class="keyword">int</span> i=<span class="number">0</span>;i&lt;num;i++)</span><br><span class="line">        &#123;</span><br><span class="line">                <span class="built_in">cout</span>&lt;&lt;<span class="string">"输入第"</span>&lt;&lt;i+<span class="number">1</span>&lt;&lt;<span class="string">"位学生的名字"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                <span class="built_in">cin</span>&gt;&gt;a[i].name; </span><br><span class="line">                <span class="built_in">cout</span>&lt;&lt;<span class="string">"输入第"</span>&lt;&lt;i+<span class="number">1</span>&lt;&lt;<span class="string">"位学生的学号"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                <span class="built_in">cin</span>&gt;&gt;a[i].number;</span><br><span class="line">                <span class="built_in">cout</span>&lt;&lt;<span class="string">"输入第"</span>&lt;&lt;i+<span class="number">1</span>&lt;&lt;<span class="string">"位学生的第一科成绩"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                <span class="built_in">cin</span>&gt;&gt;a[i].grade1;</span><br><span class="line">                <span class="built_in">cout</span>&lt;&lt;<span class="string">"输入第"</span>&lt;&lt;i+<span class="number">1</span>&lt;&lt;<span class="string">"位学生的第二科成绩"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                <span class="built_in">cin</span>&gt;&gt;a[i].grade2;</span><br><span class="line">                <span class="built_in">cout</span>&lt;&lt;<span class="string">"输入第"</span>&lt;&lt;i+<span class="number">1</span>&lt;&lt;<span class="string">"位学生的第三科成绩"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                <span class="built_in">cin</span>&gt;&gt;a[i].grade3;</span><br><span class="line">        &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">void</span> Message::o_message(Message a[],<span class="keyword">int</span> num)<span class="comment">//输出全部学生的信息</span></span><br><span class="line">&#123;</span><br><span class="line">        <span class="keyword">int</span> i;</span><br><span class="line">        <span class="keyword">for</span>(i=<span class="number">0</span>;i&lt;<span class="number">10</span>;i++)</span><br><span class="line">        &#123;</span><br><span class="line">                <span class="keyword">if</span>(a[i].number &gt;= <span class="number">0</span>)<span class="comment">//只要学号大于零就输出</span></span><br><span class="line">                &#123;</span><br><span class="line">                <span class="built_in">cout</span>&lt;&lt;<span class="string">"姓名"</span>&lt;&lt;<span class="string">"        "</span>&lt;&lt;<span class="string">"学号"</span>&lt;&lt;<span class="string">"        "</span>&lt;&lt;<span class="string">"第一科成绩"</span>&lt;&lt;<span class="string">"        "</span>&lt;&lt;<span class="string">"第二科成绩"</span></span><br><span class="line">                &lt;&lt;<span class="string">"        "</span>&lt;&lt;<span class="string">"第三科成绩"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                <span class="built_in">cout</span>&lt;&lt;a[i].name&lt;&lt;<span class="string">"        "</span>&lt;&lt;a[i].number&lt;&lt;<span class="string">"        "</span>&lt;&lt;a[i].grade1&lt;&lt;<span class="string">"                "</span></span><br><span class="line">                &lt;&lt;a[i].grade2&lt;&lt;<span class="string">"                "</span>&lt;&lt;a[i].grade3&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                &#125;</span><br><span class="line">        &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">int</span> Message::compare_max(Message a[],<span class="keyword">int</span> i)<span class="comment">//返回单个学生三科最好成绩</span></span><br><span class="line">&#123;</span><br><span class="line">        <span class="keyword">int</span> max;</span><br><span class="line">        <span class="keyword">if</span> (a[i].grade1 &gt; a[i].grade2)</span><br><span class="line">        &#123;</span><br><span class="line">                <span class="keyword">if</span>(a[i].grade1 &gt; a[i].grade3)</span><br><span class="line">                &#123;</span><br><span class="line">                        max = a[i].grade1;</span><br><span class="line">                &#125;</span><br><span class="line">                <span class="keyword">else</span></span><br><span class="line">                &#123;</span><br><span class="line">                        max = a[i].grade3;</span><br><span class="line">                &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">else</span></span><br><span class="line">        &#123;</span><br><span class="line">                <span class="keyword">if</span>(a[i].grade2 &gt; a[i].grade3)</span><br><span class="line">                &#123;</span><br><span class="line">                        max = a[i].grade2;</span><br><span class="line">                &#125;</span><br><span class="line">                <span class="keyword">else</span></span><br><span class="line">                &#123;</span><br><span class="line">                        max = a[i].grade3;</span><br><span class="line">                &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        </span><br><span class="line">        <span class="keyword">return</span> max;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">int</span> Message::compare_min(Message a[],<span class="keyword">int</span> i)<span class="comment">//返回单个学生三科最差成绩</span></span><br><span class="line">&#123;</span><br><span class="line">        <span class="keyword">int</span> min;</span><br><span class="line">        <span class="keyword">if</span> (a[i].grade1 &lt; a[i].grade2)</span><br><span class="line">        &#123;</span><br><span class="line">                <span class="keyword">if</span>(a[i].grade1 &lt; a[i].grade3)</span><br><span class="line">                &#123;</span><br><span class="line">                        min = a[i].grade1;</span><br><span class="line">                &#125;</span><br><span class="line">                <span class="keyword">else</span></span><br><span class="line">                &#123;</span><br><span class="line">                        min = a[i].grade3;</span><br><span class="line">                &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">else</span></span><br><span class="line">        &#123;</span><br><span class="line">                <span class="keyword">if</span>(a[i].grade2 &lt; a[i].grade3)</span><br><span class="line">                &#123;</span><br><span class="line">                        min = a[i].grade2;</span><br><span class="line">                &#125;</span><br><span class="line">                <span class="keyword">else</span></span><br><span class="line">                &#123;</span><br><span class="line">                        min = a[i].grade3;</span><br><span class="line">                &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">return</span> min;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">void</span> Message::av_ma_mi(Message a[],<span class="keyword">int</span> num)<span class="comment">//输出全部学生的成绩平均分，最高分和最低分</span></span><br><span class="line">&#123;</span><br><span class="line">        <span class="keyword">int</span> i=<span class="number">0</span>;</span><br><span class="line">        <span class="keyword">int</span> ave,min,max;</span><br><span class="line">        <span class="keyword">for</span>(;i&lt;num;i++)</span><br><span class="line">        &#123;</span><br><span class="line">                <span class="keyword">if</span>(a[<span class="number">10</span>].number &gt;= <span class="number">0</span>)</span><br><span class="line">                &#123;</span><br><span class="line">                 ave = (a[i].grade1+a[i].grade2+a[i].grade3)/<span class="number">3</span>;</span><br><span class="line">                 <span class="built_in">cout</span>&lt;&lt;<span class="string">"第"</span>&lt;&lt;i+<span class="number">1</span>&lt;&lt;<span class="string">"位学生的平均分是"</span>&lt;&lt;ave&lt;&lt;<span class="string">"        "</span>&lt;&lt;<span class="string">"最高分是"</span></span><br><span class="line">                 &lt;&lt;compare_max(a,i)&lt;&lt;<span class="string">"        "</span>&lt;&lt;<span class="string">"最低分是"</span>&lt;&lt;compare_min(a,i)&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                &#125;</span><br><span class="line">        &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">void</span> Message::serch(Message a[],<span class="keyword">int</span> num)<span class="comment">//通过学号查找信息</span></span><br><span class="line">&#123;</span><br><span class="line">        <span class="keyword">int</span> i=<span class="number">0</span>;</span><br><span class="line">        <span class="keyword">int</span> input_num;<span class="comment">//输入的学号 </span></span><br><span class="line">        <span class="built_in">cout</span>&lt;&lt;<span class="string">"输入想要查找的学号:"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        <span class="built_in">cin</span>&gt;&gt;input_num;</span><br><span class="line">        <span class="keyword">for</span>(;i&lt;num;i++)</span><br><span class="line">        &#123;</span><br><span class="line">                <span class="keyword">if</span>(a[i].number == input_num)</span><br><span class="line">                &#123;</span><br><span class="line">                <span class="built_in">cout</span>&lt;&lt;<span class="string">"姓名"</span>&lt;&lt;<span class="string">"        "</span>&lt;&lt;<span class="string">"学号"</span>&lt;&lt;<span class="string">"        "</span>&lt;&lt;<span class="string">"第一科成绩"</span>&lt;&lt;<span class="string">"        "</span>&lt;&lt;<span class="string">"第二科成绩"</span></span><br><span class="line">                &lt;&lt;<span class="string">"        "</span>&lt;&lt;<span class="string">"第三科成绩"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                <span class="built_in">cout</span>&lt;&lt;a[i].name&lt;&lt;<span class="string">"        "</span>&lt;&lt;a[i].number&lt;&lt;<span class="string">"        "</span>&lt;&lt;a[i].grade1&lt;&lt;<span class="string">"                "</span></span><br><span class="line">                &lt;&lt;a[i].grade2&lt;&lt;<span class="string">"                "</span>&lt;&lt;a[i].grade3&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                <span class="keyword">break</span>;</span><br><span class="line">                &#125;</span><br><span class="line">                <span class="keyword">if</span>(i == num<span class="number">-1</span>)</span><br><span class="line">                &#123;</span><br><span class="line">                        <span class="built_in">cout</span>&lt;&lt;<span class="string">"学号不存在"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                &#125;</span><br><span class="line">        &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">void</span> Message::alter(Message a[],<span class="keyword">int</span> num)<span class="comment">//通过学号修改信息</span></span><br><span class="line">&#123;</span><br><span class="line">        <span class="keyword">int</span> i=<span class="number">0</span>,k;</span><br><span class="line">        <span class="keyword">int</span> input_num;</span><br><span class="line">        <span class="built_in">cout</span>&lt;&lt;<span class="string">"输入想要修改的学号:"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        <span class="built_in">cin</span>&gt;&gt;input_num;</span><br><span class="line">        <span class="keyword">for</span>(;i&lt;num;i++)</span><br><span class="line">        &#123;</span><br><span class="line">                <span class="keyword">if</span>(a[i].number == input_num)</span><br><span class="line">                &#123;</span><br><span class="line">                        <span class="built_in">cout</span>&lt;&lt;<span class="string">"1.修改名字"</span>&lt;&lt;<span class="built_in">endl</span>; </span><br><span class="line">                        <span class="built_in">cout</span>&lt;&lt;<span class="string">"2.修改第一科成绩"</span>&lt;&lt;<span class="built_in">endl</span>; </span><br><span class="line">                        <span class="built_in">cout</span>&lt;&lt;<span class="string">"3.修改第二科成绩"</span>&lt;&lt;<span class="built_in">endl</span>; </span><br><span class="line">                        <span class="built_in">cout</span>&lt;&lt;<span class="string">"4.修改第三科成绩"</span>&lt;&lt;<span class="built_in">endl</span>; </span><br><span class="line">                        <span class="built_in">cout</span>&lt;&lt;<span class="string">"5.返回主页面"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                        <span class="keyword">do</span></span><br><span class="line">                        &#123;</span><br><span class="line">                        <span class="built_in">cin</span>&gt;&gt;k; </span><br><span class="line">                        <span class="keyword">switch</span>(k)</span><br><span class="line">                        &#123;</span><br><span class="line">                                   <span class="keyword">case</span> <span class="number">1</span>: <span class="built_in">cout</span>&lt;&lt;<span class="string">"将名字改为:"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                                                   <span class="built_in">cin</span>&gt;&gt;a[i].name;<span class="keyword">break</span>;</span><br><span class="line">                                                   </span><br><span class="line">                                   <span class="keyword">case</span> <span class="number">2</span>: <span class="built_in">cout</span>&lt;&lt;<span class="string">"将第一科成绩改为:"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                                                   <span class="built_in">cin</span>&gt;&gt;a[i].grade1;<span class="keyword">break</span>;</span><br><span class="line">                                                   </span><br><span class="line">                                   <span class="keyword">case</span> <span class="number">3</span>: <span class="built_in">cout</span>&lt;&lt;<span class="string">"将第二科成绩改为:"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                                                   <span class="built_in">cin</span>&gt;&gt;a[i].grade2;<span class="keyword">break</span>;</span><br><span class="line">                                                   </span><br><span class="line">                                   <span class="keyword">case</span> <span class="number">4</span>: <span class="built_in">cout</span>&lt;&lt;<span class="string">"将第三科成绩改为:"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                                                   <span class="built_in">cin</span>&gt;&gt;a[i].grade3;<span class="keyword">break</span>;</span><br><span class="line">                                   </span><br><span class="line">                                   <span class="keyword">case</span> <span class="number">5</span>: <span class="built_in">cout</span>&lt;&lt;<span class="string">"返回主页面"</span>&lt;&lt;<span class="built_in">endl</span>;<span class="keyword">break</span>;</span><br><span class="line">                                   </span><br><span class="line">                                   <span class="keyword">default</span>:<span class="built_in">cout</span>&lt;&lt;<span class="string">"选择错误"</span>&lt;&lt;<span class="built_in">endl</span>; </span><br><span class="line">                        &#125;</span><br><span class="line">                        &#125;</span><br><span class="line">                        <span class="keyword">while</span>(k!=<span class="number">5</span>);<span class="comment">//一直循环直到k为5</span></span><br><span class="line">                        <span class="keyword">break</span>;</span><br><span class="line">                &#125;</span><br><span class="line">                <span class="keyword">if</span>(i == num - <span class="number">1</span>)</span><br><span class="line">                &#123;</span><br><span class="line">                        <span class="built_in">cout</span>&lt;&lt;<span class="string">"学号不存在。"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                &#125; </span><br><span class="line">        &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">void</span> Message::remove(Message a[],<span class="keyword">int</span> num)<span class="comment">//通过学号删除信息</span></span><br><span class="line">&#123;</span><br><span class="line">        <span class="keyword">int</span> i=<span class="number">0</span>;</span><br><span class="line">        <span class="keyword">int</span> input_num;</span><br><span class="line">        <span class="built_in">cout</span>&lt;&lt;<span class="string">"输入想要删除的学号:"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        <span class="built_in">cin</span>&gt;&gt;input_num;</span><br><span class="line">        <span class="keyword">for</span>(;i&lt;num;i++)</span><br><span class="line">        &#123;</span><br><span class="line">                <span class="keyword">if</span>(a[i].number == input_num)</span><br><span class="line">                &#123;</span><br><span class="line">                        a[i].name = <span class="string">"该学生已不存在"</span>;</span><br><span class="line">                        a[i].number = <span class="number">0</span>;</span><br><span class="line">                        a[i].grade1 = <span class="number">0</span>;</span><br><span class="line">                        a[i].grade2 = <span class="number">0</span>;</span><br><span class="line">                        a[i].grade3 = <span class="number">0</span>;</span><br><span class="line">                        <span class="built_in">cout</span>&lt;&lt;<span class="string">"删除成功!"</span>&lt;&lt;<span class="built_in">endl</span>;<span class="keyword">break</span>;</span><br><span class="line">                &#125;</span><br><span class="line">                <span class="keyword">if</span>(i == num <span class="number">-1</span>)</span><br><span class="line">                &#123;</span><br><span class="line">                        <span class="built_in">cout</span>&lt;&lt;<span class="string">"学号不存在。"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">                &#125; </span><br><span class="line">        &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">void</span> Message::add(Message a[],<span class="keyword">int</span> num)<span class="comment">//添加学生信息</span></span><br><span class="line">&#123;</span><br><span class="line">        <span class="keyword">int</span> input_num,i=<span class="number">0</span>;</span><br><span class="line">        <span class="keyword">int</span> k = num;<span class="comment">//num要作为循环控制条件，所以将num赋值给k参与循环。否则for将进行错误的循环次数 </span></span><br><span class="line">        <span class="built_in">cout</span>&lt;&lt;<span class="string">"你想要在第几位添加学生记录:"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        <span class="built_in">cin</span>&gt;&gt;input_num;</span><br><span class="line">        <span class="keyword">for</span>(;i &lt; num + <span class="number">1</span> - input_num;i++)<span class="comment">//num + 1 _ input_num这是总共需要移动的次数 </span></span><br><span class="line">        &#123;</span><br><span class="line">                a[k] = a[k - <span class="number">1</span>];</span><br><span class="line">                k--;</span><br><span class="line">        &#125;<span class="comment">//这个循环是为了是空出需要添加记录的那个位置 </span></span><br><span class="line">        <span class="built_in">cout</span>&lt;&lt;<span class="string">"输入添加学生的姓名"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        <span class="built_in">cin</span>&gt;&gt;a[input_num - <span class="number">1</span>].name;</span><br><span class="line">        <span class="built_in">cout</span>&lt;&lt;<span class="string">"输入添加学生的学号"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        <span class="built_in">cin</span>&gt;&gt;a[input_num - <span class="number">1</span>].number;</span><br><span class="line">        <span class="built_in">cout</span>&lt;&lt;<span class="string">"输入添加学生的第一科成绩"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        <span class="built_in">cin</span>&gt;&gt;a[input_num - <span class="number">1</span>].grade1;</span><br><span class="line">        <span class="built_in">cout</span>&lt;&lt;<span class="string">"输入添加学生的第二科成绩"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        <span class="built_in">cin</span>&gt;&gt;a[input_num - <span class="number">1</span>].grade2;</span><br><span class="line">        <span class="built_in">cout</span>&lt;&lt;<span class="string">"输入添加学生的第三科成绩"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        <span class="built_in">cin</span>&gt;&gt;a[input_num - <span class="number">1</span>].grade3;</span><br><span class="line">&#125;</span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">()</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">        <span class="function"><span class="keyword">int</span> <span class="title">input</span><span class="params">()</span></span>;</span><br><span class="line">        Message a[<span class="number">10</span>];</span><br><span class="line">        <span class="keyword">int</span> i,k,num = input();</span><br><span class="line">        a[<span class="number">10</span>].i_message(a,num);</span><br><span class="line">        </span><br><span class="line">        <span class="built_in">cout</span>&lt;&lt;<span class="string">"1.输出全部学生信息"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        <span class="built_in">cout</span>&lt;&lt;<span class="string">"2.按照学号查找信息"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        <span class="built_in">cout</span>&lt;&lt;<span class="string">"3.按照学号修改信息"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        <span class="built_in">cout</span>&lt;&lt;<span class="string">"4.按照学号删除信息"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        <span class="built_in">cout</span>&lt;&lt;<span class="string">"5.按照学号增添信息"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        <span class="built_in">cout</span>&lt;&lt;<span class="string">"6.退出"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        </span><br><span class="line"><span class="keyword">do</span></span><br><span class="line">  &#123;</span><br><span class="line">          <span class="built_in">cout</span>&lt;&lt;<span class="string">"输入你想要的功能"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        <span class="built_in">cin</span>&gt;&gt;k;</span><br><span class="line">        <span class="keyword">switch</span>(k)</span><br><span class="line">        &#123;</span><br><span class="line">         </span><br><span class="line">        <span class="keyword">case</span> <span class="number">1</span>:a[<span class="number">10</span>].o_message(a,num);</span><br><span class="line">                      a[<span class="number">10</span>].av_ma_mi(a,num);<span class="keyword">break</span>; </span><br><span class="line">                      </span><br><span class="line">        <span class="keyword">case</span> <span class="number">2</span>:a[<span class="number">10</span>].serch(a,num);<span class="keyword">break</span>;</span><br><span class="line">        </span><br><span class="line">        <span class="keyword">case</span> <span class="number">3</span>:a[<span class="number">10</span>].alter(a,num);<span class="keyword">break</span>;</span><br><span class="line">        <span class="keyword">case</span> <span class="number">4</span>:a[<span class="number">10</span>].remove(a,num);<span class="keyword">break</span>;</span><br><span class="line">        <span class="keyword">case</span> <span class="number">5</span>:a[<span class="number">10</span>].add(a,num);<span class="keyword">break</span>;</span><br><span class="line">        <span class="keyword">case</span> <span class="number">6</span>:<span class="keyword">return</span> <span class="number">0</span>;<span class="keyword">break</span>;</span><br><span class="line">        <span class="keyword">default</span>:<span class="built_in">cout</span>&lt;&lt;<span class="string">"错误"</span>&lt;&lt;<span class="built_in">endl</span>;</span><br><span class="line">        &#125;</span><br><span class="line">  &#125;</span><br><span class="line">  <span class="keyword">while</span>(k!=<span class="number">6</span>);<span class="comment">//这个do-while循环可以控制功能的选择和退出系统，case 1~5对应不同的功能，case  6有return 0语句直接结束程序运行。</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>附上一个关于hexo代码高亮的操作:在_config.yml中把highlight下的auto_detect改为true。<br>然后按照<br><img src="/2019/09/29/学生信息课题实现及源代码/%E4%BB%A3%E7%A0%81%E9%AB%98%E4%BA%AE.png" alt><br>格式上传源代码</p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/09/29/学生信息课题实现及源代码/" data-id="ck4mql4da0005tsudx2585xuw" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/C-C/">C/C++</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="post-hexo + github 博客图片插入" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/09/18/hexo + github 博客图片插入/" class="article-date">
  <time datetime="2019-09-18T04:49:41.000Z" itemprop="datePublished">2019-09-18</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/09/18/hexo + github 博客图片插入/">hexo + github 博客图片插入</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>在写博客的时候 由于之前插件都已经配置好了<br>所以 只需要把我们写博客要用到的 图片放在对应文章下的文件夹里面<br>比如 ：要写一篇 test的文章<br>则source/_posts 会有对应的 test.md 和 test 文件夹<br>把需要用到的图片放置到 test文件夹中<br>然后在写文章的时候 在需要图片的位置添加一下语句<br>![](对应文章的文件夹/对应的图片 名称加后缀 )</p>
<p>this is a test<br><img src="/2019/09/18/hexo + github 博客图片插入/1.png" alt></p>
<p>另外一个小提示:GitHub博客分类只需要在建立的md文件中第四行的tags行输入标签就好了。（记得在标签加一个空格）</p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/09/18/hexo + github 博客图片插入/" data-id="ck4mql4d90003tsudnsbik1c4" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/hexo使用帮助/">hexo使用帮助</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="post-JDK环境变量配置" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/09/17/JDK环境变量配置/" class="article-date">
  <time datetime="2019-09-17T15:57:50.000Z" itemprop="datePublished">2019-09-17</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/09/17/JDK环境变量配置/">JDK环境变量配置</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>最近开始学习Java，第一步是jdk的环境配置。书上的配置过程不太清楚，我这里在总结一下。首先下载JDK后双击安装，默认它的设置就好了。之后开始配置。</p>
<ol>
<li><p>右键此电脑，属性—高级—环境变量</p>
</li>
<li><p>然后在下面的系统变量里新建一个变量名为JAVA_HOME，变量值为jdk安装路径（如：D:\Java\jdk-12.0.2）的变量。</p>
</li>
<li><p>接下来新建另一个变量名为CLASSPATH，变量值为 .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar的变量。</p>
</li>
<li><p>双击Path变量，双击修改第一条变量为jdk的bin文件夹目录（如D:\Java\jdk-12.0.2\bin;），要注意后面需要加一个“;”。</p>
</li>
<li><p>现在就算配置好了，在cmd里输入javac查看是否成功。</p>
</li>
</ol>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/09/17/JDK环境变量配置/" data-id="ck4mql4d10000tsudaugop7j5" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/java/">java</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="post-hello-world" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/09/11/hello-world/" class="article-date">
  <time datetime="2019-09-11T06:18:38.117Z" itemprop="datePublished">2019-09-11</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/09/11/hello-world/">Hello World</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>Welcome to <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/" target="_blank" rel="noopener">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html" target="_blank" rel="noopener">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues" target="_blank" rel="noopener">GitHub</a>.</p>
<h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">"My New Post"</span></span><br></pre></td></tr></table></figure>

<p>More info: <a href="https://hexo.io/docs/writing.html" target="_blank" rel="noopener">Writing</a></p>
<h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure>

<p>More info: <a href="https://hexo.io/docs/server.html" target="_blank" rel="noopener">Server</a></p>
<h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure>

<p>More info: <a href="https://hexo.io/docs/generating.html" target="_blank" rel="noopener">Generating</a></p>
<h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure>

<p>More info: <a href="https://hexo.io/docs/deployment.html" target="_blank" rel="noopener">Deployment</a></p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/09/11/hello-world/" data-id="ck4mql4d50001tsudo4shcts1" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/hexo使用帮助/">hexo使用帮助</a></li></ul>

    </footer>
  </div>
  
</article>


  


</section>
        
          <aside id="sidebar">
  
    

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/C-C/">C/C++</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hexo使用帮助/">hexo使用帮助</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/java/">java</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/python/">python</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/C-C/" style="font-size: 10px;">C/C++</a> <a href="/tags/hexo使用帮助/" style="font-size: 20px;">hexo使用帮助</a> <a href="/tags/java/" style="font-size: 10px;">java</a> <a href="/tags/python/" style="font-size: 10px;">python</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/12/">December 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/09/">September 2019</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2019/12/26/python集训-人脸识别/">python集训 _人脸识别</a>
          </li>
        
          <li>
            <a href="/2019/09/29/学生信息课题实现及源代码/">学生信息课题实现及源代码</a>
          </li>
        
          <li>
            <a href="/2019/09/18/hexo + github 博客图片插入/">hexo + github 博客图片插入</a>
          </li>
        
          <li>
            <a href="/2019/09/17/JDK环境变量配置/">JDK环境变量配置</a>
          </li>
        
          <li>
            <a href="/2019/09/11/hello-world/">Hello World</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2019 John Doe<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>



  </div>
</body>
</html>